package com.wxsong.authplatform.authweb.util;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

public class MenuResponse implements Serializable {

    private List<MenuNode> list;

    public MenuResponse(List<MenuNode> list) {
        this.list = list;
    }

    public List<MenuNode> getList() {
        return list;
    }

    public MenuResponse setList(List list) {
        this.list = list;
        return this;
    }

    public static class MenuNode{
        private Long id;
        private String text;
        private String url;
        private String state = "closed";
        private Map attributes;

        public Long getId() {
            return id;
        }

        public MenuNode setId(Long id) {
            this.id = id;
            return this;
        }

        public String getText() {
            return text;
        }

        public MenuNode setText(String text) {
            this.text = text;
            return this;
        }

        public String getUrl() {
            return url;
        }

        public MenuNode setUrl(String url) {
            this.url = url;
            return this;
        }

        public Map getAttributes() {
            return attributes;
        }

        public MenuNode setAttributes(Map attributes) {
            this.attributes = attributes;
            return this;
        }

        public String getState() {
            return state;
        }

        public MenuNode setState(String state) {
            this.state = state;
            return this;
        }
    }

    public static MenuResponse success(List list){
        return new MenuResponse(list);
    }
}
